<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla formrule library
jimport('joomla.form.formrule');
 
/**
 * Form Rule class for the Joomla Framework.
 */
class JFormRuleDate extends JFormRule
{
	public function test(& $element, $value, $group = null, & $input = null, & $form = null)
	{		
		$config = JFactory::getConfig();
		$user = JFactory::getUser();
		
		$db = JFactory::getDbo();
		$offset = JFactory::getDate(0, 'UTC');
		$offset->setTimezone(new DateTimeZone($config->get('offset')));
		
		$today = JFactory::getDate('today', 'UTC');
		
		$today = JFactory::getDate(strtotime($today->toSql(true))-strtotime($offset->toSql(true)), 'UTC');
				
		return strtotime($value)>=strtotime($today->toSql(true));
	}
}
?>